package daobeauty.interceptor.invoke.crud;

import java.util.Collection;

import org.hibernate.Session;

public class CollectionCrud implements CrudStrategy{
	private CrudAction action;
	
	public CollectionCrud(CrudAction action){
		this.action = action;
	}
	
	public void apply(Session session, Object o) {
		final Collection col = (Collection) o;
		for (Object x:col){
			action.execute(session, x);
		}
	}
	
	public String toString(){
		return "collection";
	}
}
